package com.sky.mapper;

import com.github.pagehelper.Page;
import com.sky.anno.TableInject;
import com.sky.dto.DishPageQueryDTO;
import com.sky.entity.Dish;
import com.sky.enumeration.OperationType;
import org.apache.ibatis.annotations.Mapper;

import java.util.List;

@Mapper
public interface DishMapper {

    /**
     * 根据分类id查询菜品数量
     * @param categoryId
     * @return
     */
    Integer countByCategoryId(Long categoryId);

    Page<Dish> getPage(DishPageQueryDTO dto);
    @TableInject(OperationType.INSERT)
    void save(Dish dish);


    Dish getById(Long id);

    void delete(List<Long> ids);
    @TableInject(OperationType.UPDATE)
    void update(Dish dish);

    List<Dish> getListById(Long categoryId);
}
